import {
  fakeUpdateMaterCategory,
  fakeInsertMaterialCategory,
  fakeDeleteMaterialCategory,
  fetchListMaterialCategory,
  fakeUpdateMater,
  fakeInsertMaterial,
  fakeChangeMaterialStatus,
  fetchListMaterial,
  fetchGetMaterialDetail,
  fakeInformationCollection,
  fetchInformationCollection,
  fakeUpdateInformationCollection,
  fakeDeleteInformationCollection,
  fetchInformationCollectionDetail,
  fetchDirectLive,
  fetchDirectLiveDetail,
  fakeInsertDirectLive,
  fakeDeleteDirectLive,
  fakeUpDirectLiveGoods,
  fakeDownDirectLiveGoods,
  fakeVideoCourseGoods,
  fakeVideoDownVideoCourseGoods,
  fakeSaveVideoCourse,
  fakedDeleteVideoCourseGoods,
  fetchListVideoCourse,
  fetchVideoCourseDetail,
  fakeUpVideoGoods,
  fakeDownVideoGoods,
  fakeSaveVideo,
  fakedDeleteVideo,
  fetchListVideo,
  fetchVideoDetail,
  fetchGoodsContent,
  fakeRemoveGoodsSection,
  fakeSaveGoodsSection,
  fakeSaveGoodsContent,
  fakeRemoveGoodsContent,
  fetchListLive,
  fetchLiveDetail,
  fakeDeleteLiveGoods,
  fakeDownLiveGoods,
  fakeSaveLive,
  fakeUpLiveGoods,
  fetchListLiveCourse,
  fetchLiveCourseDetail,
  fakeDeleteLiveCourseGoods,
  fakeDownLiveCourseGoods,
  fakeSaveLiveCourse,
  fakeUpCourseGoods,
  fakeDropMaterialCategory,
  fetchGoodsMarketingInfo,
  fakeSaveGoodsMarketingInfo,
  fetchListGoodsSecKill,
  fetchGoodsSecKillDetail,
  fakeGoodsSecKill,
  fakeDeleteGoodsSecKill,
  fetchLotteryDetail,
  fakeDisableGoodsLottery,
  fakeEnableGoodsLottery,
  fakeSaveGoodsLottery,
  fetchDirectLiveInteractionInfo,
  fakeSaveGoodsCommerce,
  fakeEnableGoodsCommerce,
  fakeEnableGoodsCommerceGoods,
  fakeDisableGoodsCommerce,
  fakeDisableGoodsCommerceGoods,
  fakeDeleteGoodsCommerceGoods,
  fakeSortGoodsCommerce,
  fakeGoodsContent,
  fetchPushAndLiveUrl,
  fetchOnlineUserTrendData,
  fetchLiveData,
  fetchGoodsLotteryPrizeUser,
  fakeEnableInformation,
  fakeDisableInformation,
  fetchUserInformationCollection,
  fetchGetShareInfo,
  fetchFaceToFace,
  fetchFaceToFaceDetail,
  fakeSaveFaceToFace,
  fakeUpFaceToFaceGoods,
  fakeDeleteFaceToFaceGoods,
  fakeDownFaceToFaceGoods,
  fakeGoodsPrice,
  fetchGoodsAuth,
  fakeGoodsAuth,
  fakeDeleteGoodsAuth,
  fetchGoodsWhiteList,
  fakeDeleteGoodsWhitelist,
  fakeSaveGoodsWhitelist,
  fetchGoodsByIds,
  fakeExportUserInformationCollection,
  fetchLiveInteractionInfo,
  fetchListService,
  fetchServiceDetail,
  fakeUpServiceGoods,
  fakeDownServiceGoods,
  fakeSaveService,
  fakeDeleteServiceGoods,

} from '@/services/LiveStreamingServices';
import { notification } from 'antd';
export default {
  namespace: 'liveStreaming',
  state: {
    materialCategoryList: { list: [], total: 0 },
    materialList: { list: [], total: 0 },
    informationCollectionList: { list: [], total: 0 },
    directLiveList: { list: [], total: 0 },
    videoList: { list: [], total: 0 },
    liveList: { list: [], total: 0 },
    liveCourse: { list: [], total: 0 },
    userInformationCollectionList: { list: [], total: 0 },
    secKillList: [],
    faceToFaceList: { list: [], total: 0 },
    whitelistList: { list: [], total: 0 },
    serviceList: { list: [], total: 0 },
  },
  effects: {


    *fetchListService({ payload, callback }, { call, put }) {
      const response = yield call(fetchListService, payload);
      if (!response) return;
      const { serviceList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          serviceList: {
            list: serviceList,
            total,
          },
        },
      });
    },
    *fetchServiceDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchServiceDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDeleteServiceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteServiceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveService({ payload, callback }, { call, put }) {
      const response = yield call(fakeSaveService, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `新增成功`,
      });
      callback && callback();
    },
    *fakeUpServiceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeUpServiceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeDownServiceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownServiceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });

      callback && callback();
    },



    *fakeExportUserInformationCollection({ payload, callback }, { call, put }) {
      const response = yield call(fakeExportUserInformationCollection, payload);
      if (!response) return;
      const { content } = response;
      notification.success({
        message: '温馨提示',
        description: '导出成功',
      });
      callback && callback(content);
    },
    *fetchGoodsByIds({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsByIds, payload);
      if (!response) return;
      const { goodsInfoList } = response.content;
      callback && callback(goodsInfoList);
    },
    *fetchLiveInteractionInfo({ payload, callback }, { call, put }) {
      const response = yield call(fetchLiveInteractionInfo, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },

    *fetchGoodsWhiteList({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsWhiteList, payload);
      if (!response) return;
      const { whitelistList } = response.content;
      yield put({
        type: 'save',
        payload: {
          whitelistList: {
            list: whitelistList,
            total: whitelistList.length,
          },
        },
      });
    },
    *fakeDeleteGoodsWhitelist({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteGoodsWhitelist, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveGoodsWhitelist({ payload, callback }, { call, put }) {
      const response = yield call(fakeSaveGoodsWhitelist, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `新增成功`,
      });
      callback && callback();
    },
    *fetchGoodsAuth({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsAuth, payload);
      if (!response) return;
      const { content } = response;
      callback && callback(content);
    },
    *fakeGoodsAuth({ payload, callback }, { call, put }) {
      const response = yield call(fakeGoodsAuth, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `保存成功`,
      });
      callback && callback();
    },

    *fakeDeleteGoodsAuth({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteGoodsAuth, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },

    *fetchFaceToFace({ payload, callback }, { call, put }) {
      const response = yield call(fetchFaceToFace, payload);
      if (!response) return;
      const { faceToFaceList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          faceToFaceList: {
            list: faceToFaceList,
            total,
          },
        },
      });
    },
    *fetchFaceToFaceDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchFaceToFaceDetail, payload);
      if (!response) return;
      const { content } = response;
      callback && callback(content);
    },
    *fakeSaveFaceToFace({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveFaceToFace, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeUpFaceToFaceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeUpFaceToFaceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeGoodsPrice({ payload, callback }, { call, put }) {
      const response = yield call(fakeGoodsPrice, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `修改成功`,
      });
      callback && callback();
    },

    *fakeDownFaceToFaceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownFaceToFaceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });

      callback && callback();
    },
    *fakeDeleteFaceToFaceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteFaceToFaceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },

    *fetchUserInformationCollection({ payload, callback }, { call, put }) {
      const response = yield call(fetchUserInformationCollection, payload);
      if (!response) return;
      const { userInformationCollectionList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          userInformationCollectionList: {
            list: userInformationCollectionList,
            total,
          },
        },
      });
    },
    *fakeInformationCollection({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(
        id ? fakeUpdateInformationCollection : fakeInformationCollection,
        payload,
      );
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeEnableInformation({ payload, callback }, { call, put }) {
      const response = yield call(fakeEnableInformation, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `启用成功`,
      });
      callback && callback();
    },
    *fakeDisableInformation({ payload, callback }, { call, put }) {
      const response = yield call(fakeDisableInformation, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `禁用成功`,
      });

      callback && callback();
    },
    *fakeDeletePublishMaterial({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeletePublishMaterial, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeDeleteInformationCollection({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteInformationCollection, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },

    *fetchInformationCollectionDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchInformationCollectionDetail, payload);
      if (!response) return;
      const { informationCollection } = response.content;
      callback && callback(informationCollection);
    },

    *fetchGoodsMarketingInfo({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsMarketingInfo, payload);
      if (!response) return;
      const { content } = response;
      callback && callback(content);
    },

    *fakeSaveGoodsMarketingInfo({ payload, callback }, { call, put }) {
      const response = yield call(fakeSaveGoodsMarketingInfo, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `保存成功`,
      });
      callback && callback();
    },
    *fetchListMaterial({ payload, callback }, { call, put }) {
      const response = yield call(fetchListMaterial, payload);
      if (!response) return;
      const { materialList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          materialList: {
            list: materialList,
            total,
          },
        },
      });
    },
    *fakeHandleMaterial({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(id ? fakeUpdateMater : fakeInsertMaterial, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeChangeMaterialStatus({ payload, callback }, { call, put }) {
      const response = yield call(fakeChangeMaterialStatus, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `设置成功`,
      });
      callback && callback();
    },
    *fetchListMaterialCategory({ payload, callback }, { call, put }) {
      const response = yield call(fetchListMaterialCategory, payload);
      if (!response) return;
      const { materialCategoryList } = response.content;
      callback && callback(materialCategoryList);
    },
    *fetchGetMaterialDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchGetMaterialDetail, payload);
      if (!response) return;
      const { materialDetail } = response.content;
      callback && callback(materialDetail);
    },
    *fetchInformationCollection({ payload, callback }, { call, put }) {
      const response = yield call(fetchInformationCollection, payload);
      if (!response) return;
      const { informationCollectionList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          informationCollectionList: {
            list: informationCollectionList,
            total,
          },
        },
      });
    },
    *fakeHandleCategory({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(
        id ? fakeUpdateMaterCategory : fakeInsertMaterialCategory,
        payload,
      );
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeDeleteMaterialCategory({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteMaterialCategory, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeDropMaterialCategory({ payload, callback }, { call, put }) {
      const response = yield call(fakeDropMaterialCategory, payload);
      if (!response) return;
      callback && callback();
    },
    *fetchDirectLive({ payload, callback }, { call, put }) {
      const response = yield call(fetchDirectLive, payload);
      if (!response) return;
      const { directLiveList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          directLiveList: {
            list: directLiveList,
            total,
          },
        },
      });
    },
    *fetchDirectLiveDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchDirectLiveDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDeleteDirectLive({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteDirectLive, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeDownDirectLiveGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownDirectLiveGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });
      callback && callback();
    },
    *fakeUpDirectLiveGoods({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeUpDirectLiveGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeHandleDirectLive({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeInsertDirectLive, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fetchListVideoCourse({ payload, callback }, { call, put }) {
      const response = yield call(fetchListVideoCourse, payload);
      if (!response) return;
      const { videoCourseList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          videoCourseList: {
            list: videoCourseList,
            total,
          },
        },
      });
    },
    *fetchVideoCourseDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchVideoCourseDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakedDeleteVideoCourseGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakedDeleteVideoCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveVideoCourse({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveVideoCourse, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeVideoCourseGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeVideoCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeVideoDownVideoCourseGoods({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeVideoDownVideoCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fetchListVideo({ payload, callback }, { call, put }) {
      const response = yield call(fetchListVideo, payload);
      if (!response) return;
      const { videoList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          videoList: {
            list: videoList,
            total,
          },
        },
      });
    },
    *fetchVideoDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchVideoDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakedDeleteVideo({ payload, callback }, { call, put }) {
      const response = yield call(fakedDeleteVideo, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveVideo({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveVideo, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeUpVideoGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeUpVideoGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeDownVideoGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownVideoGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });
      callback && callback();
    },
    *fetchGoodsContent({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsContent, payload);
      if (!response) return;
      const { listGoodsContentList } = response.content;
      callback && callback(listGoodsContentList);
    },
    *fakeRemoveGoodsSection({ payload, callback }, { call, put }) {
      const response = yield call(fakeRemoveGoodsSection, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveGoodsSection({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveGoodsSection, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeRemoveGoodsContent({ payload, callback }, { call, put }) {
      const response = yield call(fakeRemoveGoodsContent, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveGoodsContent({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveGoodsContent, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },

    *fetchListLive({ payload, callback }, { call, put }) {
      const response = yield call(fetchListLive, payload);
      if (!response) return;
      const { liveList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          liveList: {
            list: liveList,
            total,
          },
        },
      });
    },
    *fetchLiveDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchLiveDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDeleteLiveGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteLiveGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveLive({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveLive, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeUpLiveGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeUpLiveGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeDownLiveGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownLiveGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });
      callback && callback();
    },

    *fetchListLiveCourse({ payload, callback }, { call, put }) {
      const response = yield call(fetchListLiveCourse, payload);
      if (!response) return;
      const { liveCourseList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          liveCourse: {
            list: liveCourseList,
            total,
          },
        },
      });
    },
    *fetchLiveCourseDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchLiveCourseDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDeleteLiveCourseGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteLiveCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSaveLiveCourse({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeSaveLiveCourse, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },
    *fakeUpCourseGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeUpCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `上架成功`,
      });
      callback && callback();
    },
    *fakeDownLiveCourseGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDownLiveCourseGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `下架成功`,
      });
      callback && callback();
    },

    *fetchListGoodsSecKill({ payload, callback }, { call, put }) {
      const response = yield call(fetchListGoodsSecKill, payload);
      if (!response) return;
      const { secKillList, total } = response.content;
      yield put({
        type: 'save',
        payload: {
          secKillList: {
            list: secKillList,
            total,
          },
        },
      });
    },
    *fetchGoodsSecKillDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsSecKillDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDeleteGoodsSecKill({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteGoodsSecKill, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeGoodsSecKill({ payload, callback }, { call, put }) {
      const { id } = payload;
      const response = yield call(fakeGoodsSecKill, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: id ? '修改成功' : `新增成功`,
      });
      callback && callback();
    },

    *fetchDirectLiveInteractionInfo({ payload, callback }, { call, put }) {
      const response = yield call(fetchDirectLiveInteractionInfo, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fetchLotteryDetail({ payload, callback }, { call, put }) {
      const response = yield call(fetchLotteryDetail, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fakeDisableGoodsLottery({ payload, callback }, { call, put }) {
      const response = yield call(fakeDisableGoodsLottery, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `禁用成功`,
      });
      callback && callback();
    },
    *fakeEnableGoodsLottery({ payload, callback }, { call, put }) {
      const response = yield call(fakeEnableGoodsLottery, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `启用成功`,
      });
      callback && callback();
    },
    *fakeSaveGoodsLottery({ payload, callback }, { call, put }) {
      const response = yield call(fakeSaveGoodsLottery, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `新增成功`,
      });
      callback && callback();
    },

    *fakeSaveGoodsCommerce({ payload, callback }, { call, put }) {
      const response = yield call(fakeSaveGoodsCommerce, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `新增成功`,
      });
      callback && callback();
    },

    *fakeEnableGoodsCommerce({ payload, callback }, { call, put }) {
      const response = yield call(fakeEnableGoodsCommerce, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `启用成功`,
      });
      callback && callback();
    },
    *fakeEnableGoodsCommerceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeEnableGoodsCommerceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `启用成功`,
      });
      callback && callback();
    },
    *fakeDisableGoodsCommerce({ payload, callback }, { call, put }) {
      const response = yield call(fakeDisableGoodsCommerce, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `禁用成功`,
      });
      callback && callback();
    },
    *fakeDisableGoodsCommerceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDisableGoodsCommerceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `禁用成功`,
      });
      callback && callback();
    },
    *fakeDeleteGoodsCommerceGoods({ payload, callback }, { call, put }) {
      const response = yield call(fakeDeleteGoodsCommerceGoods, payload);
      if (!response) return;
      notification.success({
        message: '温馨提示',
        description: `删除成功`,
      });
      callback && callback();
    },
    *fakeSortGoodsCommerce({ payload, callback }, { call, put }) {
      const response = yield call(fakeSortGoodsCommerce, payload);
      if (!response) return;
      callback && callback();
    },
    *fakeGoodsContent({ payload, callback }, { call, put }) {
      const response = yield call(fakeGoodsContent, payload);
      if (!response) return;
      callback && callback();
    },

    *fetchPushAndLiveUrl({ payload, callback }, { call, put }) {
      const response = yield call(fetchPushAndLiveUrl, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },

    *fetchOnlineUserTrendData({ payload, callback }, { call, put }) {
      const response = yield call(fetchOnlineUserTrendData, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fetchLiveData({ payload, callback }, { call, put }) {
      const response = yield call(fetchLiveData, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fetchGoodsLotteryPrizeUser({ payload, callback }, { call, put }) {
      const response = yield call(fetchGoodsLotteryPrizeUser, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
    *fetchGetShareInfo({ payload, callback }, { call, put }) {
      const response = yield call(fetchGetShareInfo, payload);
      if (!response) return;
      const { content = {} } = response;
      callback && callback(content);
    },
  },
  reducers: {
    save(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
